package cn.ii8080.i8.module.account.client;

import org.springframework.web.bind.annotation.*;

import java.io.Serializable;
import java.util.List;

public interface BaseClient<T> {
    //增加
    @PostMapping
    Boolean save(@RequestBody T t);

    //删除
    @DeleteMapping("/{id}")
    Boolean remove(@PathVariable("id") Serializable id);

    //修改
    @PutMapping
    Boolean update(@RequestBody T t);

    @GetMapping("/one/{column}/{val}")
    T getOne(@PathVariable("column") String column, @PathVariable("val") String val);

    @GetMapping("/list/{column}/{val}")
    List<T> getList(@PathVariable("column") String column, @PathVariable("val") String val);

    @GetMapping("/{id}")
    T getById(@PathVariable("id") Serializable id);
}
